This article is a guide for the ESP8266 GPIOs: pinout diagrams, their functions and how to use them.
The ESP8266 12-E chip comes with 17 GPIO pins. Not all GPIOs are exposed in all ESP8266 development boards, some GPIOs are not recommended to use, and others have very specific functions.
With this guide, you’ll learn how to properly use the ESP8266 GPIOs and avoid hours of frustration by using the most suitable pins for your projects.
Note: not all GPIOs are accessible in all development boards, but each specific GPIO works in the same way regardless of the development board you’re using. If you’re just getting started with the ESP8266, we recommend checking out our ESP8266 Guides.
ESP8266 12-E Chip Pinout
The following figure illustrates the ESP8266 12-E chip pinout. Use this diagram if you’re using an ESP8266 bare chip in your projects.
Note: not all GPIOs are accessible in all development boards, but each specific GPIO works in the same way regardless of the development board you’re using. If you’re just getting started with the ESP8266, we recommend reading our guide: Getting Started with the ESP8266.
At the moment, there are a wide variety of development boards with the ESP8266 chip that differ in the number of accessible GPIOs, size, form factor, etc…
The most widely used ESP8266 boards are the ESP-01, ESP8266-12E NodeMCU Kit, and the Wemos D1 Mini. For a comparison of these board, you can read this guide: ESP8266 Wi-Fi Development Boards comparison.
ESP8266-01 Pinout
If you’re using an ESP8266-01 board, you can use the following GPIO diagram as a reference.
ESP8266 12-E NodeMCU Kit
The ESP8266 12-E NodeMCU kit pinout diagram is shown below.
Wemos D1 Mini Pinout
The following figure shows the WeMos D1 Mini pinout.
Download PDF with ESP8266 Pinout Diagrams
We’ve put together a handy PDF that you can download and print, so you always have the ESP8266 diagrams next to you:
Download PDF Pinout Diagrams »
ESP8266 Peripherals
The ESP8266 peripherals include:
- 17 GPIOs
- SPI
- I2C (implemented on software)
- I2S interfaces with DMA
- UART
- 10-bit ADC
Best Pins to Use – ESP8266
One important thing to notice about ESP8266 is that the GPIO number doesn’t match the label on the board silkscreen. For example, D0 corresponds to GPIO16 and D1 corresponds to GPIO5.
The following table shows the correspondence between the labels on the silkscreen and the GPIO number as well as what pins are the best to use in your projects, and which ones you need to be cautious.
The pins highlighted in green are OK to use. The ones highlighted in yellow are OK to use, but you need to pay attention because they may have unexpected behavior mainly at boot. The pins highlighted in red are not recommended to use as inputs or outputs.
Label | GPIO | Input | Output | Notes |
D0 | GPIO16 | no interrupt | no PWM or I2C support | HIGH at boot used to wake up from deep sleep |
D1 | GPIO5 | OK | OK | often used as SCL (I2C) |
D2 | GPIO4 | OK | OK | often used as SDA (I2C) |
D3 | GPIO0 | pulled up | OK | connected to FLASH button, boot fails if pulled LOW |
D4 | GPIO2 | pulled up | OK | HIGH at boot connected to on-board LED, boot fails if pulled LOW |
D5 | GPIO14 | OK | OK | SPI (SCLK) |
D6 | GPIO12 | OK | OK | SPI (MISO) |
D7 | GPIO13 | OK | OK | SPI (MOSI) |
D8 | GPIO15 | pulled to GND | OK | SPI (CS) Boot fails if pulled HIGH |
RX | GPIO3 | OK | RX pin | HIGH at boot |
TX | GPIO1 | TX pin | OK | HIGH at boot debug output at boot, boot fails if pulled LOW |
A0 | ADC0 | Analog Input | X |
Continue reading for a more detailled and in-depth analysis of the ESP8266 GPIOs and its functions.
GPIOs connected to the Flash Chip
GPIO6 to GPIO11 are usually connected to the flash chip in ESP8266 boards. So, these pins are not recommended to use.
Pins used during Boot
The ESP8266 can be prevented from booting if some pins are pulled LOW or HIGH. The following list shows the state of the following pins on BOOT:
- GPIO16: pin is high at BOOT
- GPIO0: boot failure if pulled LOW
- GPIO2: pin is high on BOOT, boot failure if pulled LOW
- GPIO15: boot failure if pulled HIGH
- GPIO3: pin is high at BOOT
- GPIO1: pin is high at BOOT, boot failure if pulled LOW
- GPIO10: pin is high at BOOT
- GPIO9: pin is high at BOOT
Pins HIGH at Boot
There are certain pins that output a 3.3V signal when the ESP8266 boots. This may be problematic if you have relays or other peripherals connected to those GPIOs. The following GPIOs output a HIGH signal on boot:
- GPIO16
- GPIO3
- GPIO1
- GPIO10
- GPIO9
Additionally, the other GPIOs, except GPIO5 and GPIO4, can output a low-voltage signal at boot, which can be problematic if these are connected to transistors or relays. You can read this article that investigates the state and behavior of each GPIO on boot.
GPIO4 and GPIO5 are the most safe to use GPIOs if you want to operate relays.
Analog Input
The ESP8266 only supports analog reading in one GPIO. That GPIO is called ADC0 and it is usually marked on the silkscreen as A0.
The maximum input voltage of the ADC0 pin is 0 to 1V if you’re using the ESP8266 bare chip. If you’re using a development board like the ESP8266 12-E NodeMCU kit, the voltage input range is 0 to 3.3V because these boards contain an internal voltage divider.
You can learn how to use analog reading with the ESP8266 with the following guide:
On-board LED
Most of the ESP8266 development boards have a built-in LED. This LED is usually connected to GPIO2.
The LED works with inverted logic. Send a HIGH signal to turn it off, and a LOW signal to turn it on.
RST Pin
When the RST pin is pulled LOW, the ESP8266 resets. This is the same as pressing the on-board RESET button.
GPIO0
When GPIO0 is pulled LOW, it sets the ESP8266 into bootloader mode. This is the same as pressing the on-board FLASH/BOOT button.
GPIO16
GPIO16 can be used to wake up the ESP8266 from deep sleep. To wake up the ESP8266 from deep sleep, GPIO16 should be connected to the RST pin. Learn how to put the ESP8266 into deep sleep mode:
I2C
The ESP8266 doens’t have hardware I2C pins, but it can be implemented in software. So you can use any GPIOs as I2C. Usually, the following GPIOs are used as I2C pins:
- GPIO5: SCL
- GPIO4: SDA
SPI
The pins used as SPI in the ESP8266 are:
- GPIO12: MISO
- GPIO13: MOSI
- GPIO14: SCLK
- GPIO15: CS
PWM Pins
ESP8266 allows software PWM in all I/O pins: GPIO0 to GPIO15. PWM signals on ESP8266 have 10-bit resolution. Learn how to use ESP8266 PWM pins:
Interrupt Pins
The ESP8266 supports interrupts in any GPIO, except GPIO16.
Wrapping Up
We hope you’ve found this guide for the ESP8266 GPIOs useful. If you have some tips on how to use the ESP8266 GPIOs properly, you can write a comment below.
We also have a similar guide for the ESP32 GPIOs that you can read.
If you’re getting started with the ESP8266, we have some great content you might be interested in:
- Home Automation using ESP8266 (course)
- Getting Started with the ESP8266
- 30+ ESP8266 Projects and Tutorials
- ESP8266 Web Server Tutorial
- ESP32 vs ESP8266 – Pros and Cons
Thanks for reading.
Excellent all in one place info. Thanks
Thanks 🙂
A really comprehensive guide. I’ve done a lot of trial and error with these devices. I now have all of the insight to design my projects and possibly a commercial product correctly from scratch. I am much endebted.
Sensacional, simplesmente o melhor site do gênero. Parabens!!!
Rui, your site is one of the best there is for learning ESP8266 (& ESP32).
I’ve struggled a lot with projects that wont boot etc. and now I understand why !!!
Your articles are always very professional, very interesting and easy to follow.
I have found many solutions to problems by studying your articles & projects !!
Thank you !!
Hi.
Thank you so much for your nice works.
I’m very happy to see that our readers really enjoy our work. That keeps me motivated to write even better content.
Regards,
Sara
Great article, thanks !!
It’s always convenient to have tables showing the pin outs of these fantastic cards.
I’ve been trying to flash an ESP-07S with nodemcu firmware lately, but I didn’t succeed. Do you have a chart for this card?
Greetings. Mike.
yes
Yeah.I know the chart card.do you want that .ask me. i will provide you.
Thank you for producing comprehensive guides to ESP8266 devices /boards (also ESP12E), they provide very useful and accessible information sources, without the need for internet searches.
Thank you 🙂
Thanks for this useful guide to the pinouts.
Does the Wemos D1 mini have an onboard voltage divider for the analog input? I ask because I just tried an ACS712 Current Sensor Module, 5V powered, and divided down to the 1V range with a 4K7 & 1K2 resistor divider.
The ACS712 gives a “neutral” reading of half the range, so I was expecting around 512 with nothing connected. Instead I get 170, which would be expected if the A0 input was divided onboard by 3.
(Now what do I need to do to turn a divide by 3 into a divide by 5?)
hey, did you find an answer to this problem?
I face the same! Thanks a lot
wemos D1 mini having voltage divider for A0 input. so the input is tolerant upto VCC 3.3V.
this is schematic. where you can see a 100k/220k divider at A0 input,
escapequotes.net/wp-content/uploads/2016/02/wemos-d1-mini-shematics.jpg
you can check this discussed here:
github.com/esp8266/Arduino/issues/721
This clears up some questions, thanks!
Is there a key or guide for the color tabs used in the pinout diagrams? I understand black and red, but light blue, gray, etc?
Thanks
Hi Dave.
Those are just random colors we’ve chosen to differentiate the pins.
Pins with similar functions are highlighted with the same color.
For example, SPI is green, I2C is light blue, etc.
Regards,
Sara
Wonderful, clear and concise article.
I bough one of your guide and it’s written this way.
Pleasant to read and to use!
Thank you so much! 🙂
O trabalho de vcs é perfeito, sempre fico impressionado com a qualidade e precisão de suas postagens.
Obrigada 🙂
You are correct, the A0 input is divided. See drawing.
escapequotes.net/esp8266-wemos-d1-mini-pins-and-diagram/
In the middle of the schematic far right you can the the divider.
find also the updated files, were some errors at the source
Forgot to mention that you can modify the voltage divider on the ACS712 to a 5 to 3 V divider. Here some math comes in. since you will load 1 voltage divider by another. Some testing needed. Final calibration can be done in software.
Great tutorial! Thank you, Sara and Rui.
Roberto
Austria
Thank you 🙂
Re voltage divider on the D1 Mini, the link below says onboard there are 220K and 100K resistors, so to divide down 5 volts, you add 180K in series to A0.
letscontrolit.com/wiki/index.php/DC_Voltage_divider
Thanks for answering.
Great resource, thank you.
Your site is one that I recommend to folks often as your courses are so well put together. Please keep it up 🙂
Thank you so much for recommending our our to your friends 🙂
I have an ESP-WROOM-32 board, what pin-out should I follow? I looks kinda like the ESP8266 12-E NodeMCU Kit, pins are differently labelled. Any assistance.
Hi Logan.
We have a similar guide for the ESP32. Take a look at it: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/
Regards,
Sara
As always, @rnt, best ideas and guidelines!
You’ve just answer my problem, very good for reference.
Thank you!
Thank you.
Excellent guide. Thanks.
Greetings
Excellent guide.
I was struggling with a D1 mini, three switch buttons and four relays.
It seems that I must use an esp32.
Thanks
Yes, it should probably be more appropriate.
We also have a guide about the EPS32 GPIOs that might help you a lot: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/
Regards,
Sara
A D1 mini should be able to handle 3 switch buttons and 4 relays. Note that RX and TX can be made to be GPIOs if need to be. I’ve been bitten by boot condition needs–specifically, I had a pullup for a DS18B20 on D8, which disabled normal booting.
It’s also possible to add an MCP23017 16-bit I2C GPIO expander module (<$3US on ebay) to gain a lot more I/Os on a D1 Mini (I like the D1 Mini a lot).
Hi Sara and Rui,
What is the function of the “EN” pin on NodeMCU?
Cheers,
Gerard
Hi Gerard.
That’s the Enable pin for the ESP8266. When it is pulled down, it resets the ESP8266.
Regards,
Sara
Hey guys! This page is very useful!
I’m currently prototyping using a Wemos D1 mini, but tht final processor will be an ESP12EX. Since it has more GPIOs available at the bottom (GPIO: 6, 8, 10 , 9, 7, 11) do you know if these are usable? I’m planning to create my own breakout board since I don’t need the extra stuff NodeMCU has. Thank you!
Hi Jose.
Those pins are usually connected to the ESP8266 flash chip. So, it is better to use other pins.
Regards,
Sara
Thanks so much! Saved me a lot of grief, as I was going to use a few GPIO inputs that would have not worked well.
The information here is pure gold. Thank you for the detailed explanation on ESP8266!
You’re welcome 😀
Hello,
You have “MOSI” and “MISO” incorrectly swapped in the “SPI” section.
Everywhere else it’s correct: in the pinout pictures, the Best Pins to Use table.
Cheers.
Hi.
Yes, you’re right!
Thanks for noticing. It’s updated now.
Regards,
Sara
This is a fantastic reference. I was wondering if you would consider adding HTML id tags so I can to this page, but a specific section. Since the page is so long I’d like to be able to link directly to the pin table if possible.
Hi Scott.
I added an ID to the table. You can use this URL: https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/#table
Regards,
Sara
Can we use GPIO2 and GPIO14 as I2C line on ESP12F?
Hi.
Yes, I think so.
You just need to declare that on the code:
Wire.begin(SDA, SCL);
Regards,
Sara
Nice tutorials. I have several 8266 01 boards that were programmed as OTA and just reporting near by wi fi stations. Lost the documentation, now trying to restore to factory fresh. Just can not accomplish the task. Will keep trying.
Hi.
Follow this: https://rntlab.com/question/how-perform-reset-factory-esp32/
Regards,
Sara
Really useful information, I wish I’d seen this before I did my first 8266 project the hard way.
One little trick that worked for me was using the 12-E NodeMCU. I found the 3.3V analogue input too high – I needed 1.0V (and expected this from the documentation I had at the time). With some careful soldering I was able to short out the upper voltage divider resistor giving me 1V sensitivity with (if I recall) 100 Kohm input impedance. Normally I wouldn’t attempt such an intricate process but you just need to attach a wire to the copper pad on the chip, actually not so hard.
Hello,
I have come up with mention of the fact that the Max of voltage at ADC0 on bare ESP8266 chips is 1V.
Is this true of ESP8266 12-E/F.
And is this true of Wemos D1R1/R2 also.
Appreciate your response.
Best Regards.
Yes, the bare chip has a maximum voltage of 1v, of course it is possible to increase that with a simple potential divider network (2 resistors, one of which is probably already on your chip/board). Some of the development boards add a potential divider network usually to make the sensitivity 3.3v at the A0 pin, I only have direct experience of the NodeMCU board where this is the case, but it might also be true of the products you mention.
The input impedance at A0 is 330Kohm (probably true for all such boards), so if you want to increase the max voltage further, you can add a resistor in series with A0 R = Vmax * 100-330 K. As I said previously if you want to decrease the Vmax with a little soldering* skill you can attach a resistor directly to the analogue input pin of the chip itself R = Vmax*100 – 100 K.
*Not sure about the wisdom of this (may not be legal in your jurisdiction), but I have some old leaded solder (left over from my youth before health and safety) it melts about 20 degrees lower than unleaded, so if you set your regulated iron to coolish, its great if you want to tweak boards with surface mount components without risk of disturbing anything.
Please, Please put together a pinout page like this one. Every time I google for images on espXXX pinouts, I always get your page. I looked but was not able to find one for the Arduino boards. Yours is clean and concise.
It would be a GREAT addition !!!
As always, thanks for all the work and time you put in!
BG
Thanks for the suggestion.
Regards,
Sara
Short and concise. Fantastic job to pulling the relevant information into one place.
Great work.
Thanks 😀
Hi, I use the info above regularly. Thanks. I have a problem which I hope you can solve. I am using GPOI 14 15 and 16 as switch position detectors.on an ESP 8266 NODEMCU
int RED = digitalRead (D5);
if(RED==0)
{digitalWrite (LED, LOW);}
else
{digitalWrite (LED, HIGH);}
delay(100);
digitalWrite (D5, HIGH);
I can detect when RED is LOW but the LED stays on even with the last line setting D% HIGH. Any suggestions?
If a pin is set for input, it will have very high impedance and the voltage present will be controlled by the external circuits. You can’t meaningfully write to it to change that.
You likely (but since I don’t know what you’re trying to do, I can’t be sure) need to arrange pull up (or perhaps down) resistors to ensure that the signal “floats” where you want it to when the input conditions change.
But bottom line; at any given instant, a pin is either input OR output. Not both.
HI, I think you have to add that GPIO16 can’t be configured with INPUT_PULLUP
Thanks
Thanks so much for the insight
Hello! I am trying to connect a 0.96 inch oled display to an esp12f module. But its to complicated for me to find the connection pins. I am using the weather station example. which part of the pin defination should i modify or the connections should be same?
Hi.
What do you mean?
You should connect the display to the I2C pins GPIO 5(SCL) and GPIO 4(SDA).
You can learn more about the OLED display here: https://randomnerdtutorials.com/esp8266-0-96-inch-oled-display-with-arduino-ide/
Regards,
sara
Some of the limitations described depend on the IDE used.
E.g. with the Arduino IDE you can use D0 / GPIO16 as a PWM output.
Putting GPIO16 low does only, just after a reset, lead to bootloader mode.
In normal run, GPIO16 can be used normally.
Thank you for this very useful resource. I had been struggling with a project and looking at this page helped me to find the cause of the problem (in my case it was accidentally pulling GPIO15 high preventing me from flashing my sketch).
The information is comprehensive and very clearly presented. You have done a great job of explaining a slightly tricky topic.
Thank you.
I’m glad this was useful.
Regards,
Sara
Great job guys.
Thank you for your efforts.
I have a few boards that are not working but I believe that the Esp8266 chip is still usable. I was hoping to find a way to just use the WiFi chip on a Arduino Nano or Uno for projects. Do you have any schematics as to how to connect a bare chip to an Arduino? Thanks,I am a subscriber and have purchased teh Home Automation program from you and are starting to actually learn s few things, keep up the good work.
Hi.
Unfortunately, we don’t have any information on how to do that.
Thanks for following our work.
Regards,
Sara
The pins of the bare chip are shown in this article, see “ESP8266 12-E Chip Pinout”
Hi
Apart from experience, is there any Espressif document that justify that GPIO1 cannot be pulled low at boot ?
It’s not part of the boot_mode pins, it is an UART TX.
So nothing should prevent to have a pull-down on that pin.
I’m looking for any reference to an Espressif doc that would explain this.
Thanks
Hi,
GPIO-1 is used for Tx but it can also be used as GPIO of course.
At boot it is used by default as debug output and for that reason it must be found in high state (done by internal pull-up resistor).
If you draw this pin to ground and a high debug data is output at boot a situation of short will occur at this pin.
Most important pins not discussed – the POWER pins.
If you power from a 5v supply – on Vin, Does it blow up? Or, is Vin 5v tolerant?
The IO ports – 5v out/in, or only 3.3v out / in max?
Do you in practice connect all 3,3v pins together on a PCB – are they 3.3v inputs or outputs?
Please add to this info page.
Regards
Z
the Vin pin on a NodeMCU is attached to the same regulator as the USB port – it’s rated up to 20V though I never power it with anything higher than 5V. You can power the board through the 3V3 pin with 3.3V but there is no regulator so it is not advised – I typically use that as logic level power output for peripherals.
Hi
thanks for the tutorial
how can i use SD0 or SD1 or SD2 or SD3 or CMD or CLK as input pin ?
thanks
Hi,
I intend to use GPIO12,13,14 for a rotary encoder wich comes with two outputs which are connected to ground when not used. This means that two input GPIO12&GPIO13 (for instance) will be to ground most of the time.
Do I have to add a resistor in order to limit the current to those inputs ?
Thanks. Ur sites is quite helpful
Greetings!!
I have 6 ESP 8266 nodemcu, and they can’t connect to the network, I’ve been trying for 3 days but just look for the network and don’t connect.
I use WebScan and it finds the network, but it doesn’t connect.
Did they have any tips? Well I already searched the whole net and I didn’t find it!
Thanks!
Hi Carlos.
That problem is usually caused if the SSID or the password are not correct.
Regards,
Sara
Hello again,
Re: the ESP8266 12-E NodeMCU
I’m building for an external project, OTA and sleep/wake cycles are important.
So, I’m trying to figure out whether RST can remain connected to D0 (gpio16).
Or should I, perhaps, solder in a physical switch?
Thanks, again,
Chris
Hi Sara,
Please ignore (or remove) my previous question – Re: connecting RST to D0 .
I have posted in the wrong article.
Please remove both if possible.
Chris
Hi, Guys:
I can’t avoid it! whenever I have any difficulties, I have resorted to your posts which have been a great help to me. That’s why I’m here again.
I’m using GPIO13/D7 (SPI/MOSI) as an input/binary sensor, pulled up with 10K resistor.
In this condition the ESP8266(D1-mini) doesn´t boot up. If I disconnect the sensor from the D7 input, the D1 mini boots normally. If I connect the sensor in D7 input after boot, everything it’s runs smoothly without problems. As per your pinout reference chart above, I can’t identify any rmks which can cause this issue. Can you give me any tip? What I’m doing wrong?
Hi.
To be honest, I’m not sure why it is having that behavior.
GPIO 13 is not an essential pin for the boot process, as far as I’m concerned.
If it doesn’t work, I can only recommend trying to use a different GPIO.
Regards,
Sara
Tks for yr prompt reply!
I’ll keep investigating. I’ll share if I’ll get any conclusion.
Tks anyway.
About the reported issue, I turned it around with using another free GPIO
Hi,
for the sake of the precision: ESP8266 will fail to boot if GPIO15 is NOT forced down because the internal pullup is likely active during the first read operation.
By applying external pulldown of 10kOhm (this make sure the boot) I measured 0.9V on GPIO15 (up to 35ms from startup). This made me think about the internal pullup.
This is important because high values of the pulldown resistor (ex. 200kOhm) will not allow the boot.
Regards.
I forgot to say that this occur on ESP12E/ESP12F modules only. NodeMCU, Wemos mini and other modules already have the proper pulldown on board.
Regards.
Thank you so much. few questions:
1) using nodemcu LULA and a telegram bot library it works.
2) using the same library in a nodemcu AMICA it resets and restart every 22 minutes.
do you know how to avoid it?
and most important question: Digital Input Voltage is 0-3.3v . i have some sensors at 5v output, and i dont have enough space for a voltage divider. can i connect 5v to digital input with a single resistor between 5v_output and Nodemcu_input_pin, to reduce the Current shocking the input and work fine? if so, how much Ohm?
Once we give low input to pin 16 of NodeMCU ESP8266, it remains low, see my code below which is not able to switch off led because of this issue, can’t we use pin 16 as general purpose input?
See my complete code
https://github.com/mrnams/IOT/blob/main/ESP8266/Examples/Basic/One-Led-Two-Push-Buttons
Hi,
GPIOs up to 15 have a pullup only. GPIO16 (D0) has a pulldown only. In your case (GPIO16), you have to disable the pullup and apply an external pullup resistor (or connect the switch to the 3.3V instead of the ground)
Regards
Andrea.
correction … (or connect the switch to the 3.3V instead of the ground and enable the pulldown)
Hi,
thank you very much for your website which is really full of informations and useful.
Lately I faced a problem that you did not point in your description of pins.
After looking all around I’ve learned that is A0 pin is used too often doing digital read it will block the WIFI to run normally. Without timer on the digital read the wifi was not even showing up in wifi list and now I put a 100ms delay between each analog read it works fine.
this may be useful for other users.
Thanks for sharing.
Regards,
Sara
This was invaluable for the project I’m building. I was frustrated why strange things happened at boot, or it didn’t boot at all. Now I know how the pins behave and have been able to adapt my project accordingly.
Thank you for this tutorial! It’s a big help!
Thanks to your advice, I was able to choose the right pins for my project immediately, without wasting time!
Random Nerd Tutorials is a point of reference for me, I often visit your tutorials: congratulations!
Thank you 🙂
Hi Sara,
Your guide is really big help for me to debug issue with relay I made with nodemcu. I’d like to know if it’s okay for me make a Chinese version of this guide and put a credit ref. back to this url?
Hi.
Yes, as long as you reference this article with a link to this page.
Regards,
Sara
Hi,
I can’t find ESP6288-01 on the list. Can you help me please, how to connect ESP01 to Max7219 (SPI). Is it possible?
Thanks.
ESP6288-01 could not be found.
https://www.espressif.com/en/support/documents/technical-documents?keys=ESP8266
Hi,
Sorry for typo…. supposed to be ESP8266-01 or ESP01, and yeah, thanks for the link that I’ve already there for it previously, but can’t get the answer or example on how to connect ESP01 to MAX7219 (I’ve no problem with other ESP board).
Anyway, thanks a lot for the reply.
Hi Sara,
After a month of working to get there, I created a MetarMap to display weather conditions at airports all over the U.S.. It works great.
Now I would like to turn the LED_PIN on and off based on the time of day, so that during the night, the map is turned off. The MetarMap already has a WiFi connection and I have found your sketch to access the time of day, created it and it works. Now I would like to use that time of day to turn the map on and off. Do you have a tutorial that explains how to do this?
Hi.
No, I don’t have any specific tutorial to do that.
But, you can easily add if statements to check the time and turn the LED on and off using the digitalwrite() function.
Regards,
Sara
Hello,
You specify that GPIO0 and GPIO2 are pulled up. Do you mean pulled internally or should i pulled them up with external resistors? If yes, then how high a value can i use? is 200K acceptable?
Like your article and your training books.
Thanks
Hi.
They are internally pulled-up.
Regards,
Sara
Hi, where can I find the pins of the chip on ESP01? Not the pins of the board. Thank you.
Hi,
ESP-01 is the name of the module, not that of the chip.
But sorry, I don’t know how to append a .jpg schematic to this answer.
ESP-12 and ESP-01 pictures are shown at the top of this page.
Hello,
I am using ESP8266 12-E board. I want to set GPIO12 high when all processing is done. As per the table you provided, i would set GPIO12 to High.
So, in the beginning i set it low
ESP_Done = 12
pinMode(ESP_Done, OUTPUT)
digitalWrite(ESP_Done, LOW)
….
…..at the end of the program i do.
digitalWrite(ESP_Done, HIGH).
For some reason GPIO12 goes up before “digitalWrite(ESP_Done, HIGH)” runs. Is GPIO12 used for something else to make it work that way?
thanks
I may just have a noisy line, unless you say GPIO12 has other functions that go into play.
thanks
All of my esp8266E V3 devkit boards (CH340) have VV and G where the older versions have RSV. The VV pin is 5V output (if you are using 5V input, either VIN or USB).
Thanks .. I wish I read this before : I confirm boot fails when D4 is pulled low to the base of a transistor connected to a relay :-/
It won’t work with a bipolar of course but would work fine with a mosfet
Just add a note again GPIO1/TX pin stating that its unsuitable for connecting relays or to outputs that doesn’t expect to be momentarily triggered on when the board boots up. This pin alone goes low momentarily on boot and active low relays get triggered up if connected to this port.
Great article, it helped me finish a project on an industrial application!
Dear Sara,
I used ESP8266 12-E NodeMCU module connect with 4 channel module. I found big problem. It is when reconnecting to wifi relays are shot time disconnect. Every reconnecting, I found this problem.
Pls, help me.
Hi.
Try choosing different GPIOs for your relays.
Regards,
Sara
in ESP-01 what pin best to use?
because,
GPIO0 = PIN FLASH
GPIO1 = PIN TX
GPIO2 = connected to on-board LED, boot fails if pulled LOW
GPIO3 = PIN RX
so, what pin to use?
thanks
sahat
Hi.
After uploading code, you can use GPIO2, for example.
Hello, you have put up a real great document with very important information in one place. About the GPIO6 to GPIO11, you have mentioned they may not be used. Does that means they are not available as GPIO at all? or we need some configuration to make them work as GPIO?I was able to use GPIO10 as ouput, but any other pin i configure as output the, program resets continuously. Will be glad if you can confirm so we will not dig into it.
Hi.
They are not available as pins in most ESP8266 development boards.
You should not use those pins to connect peripherals because they are being used internally by the chip for essential functions (connected to the flash chip).
Regards,
Sara
Sorry, but GPIO0 is not OK for output if you want to use deep sleep mode. In deep sleep GPIO 0 is high(not sure why and I can’t change it)… I wasn’t aware and chose to use that pin for my LED. Therefore the LED is on in deep sleep, which draws current – whole point of the deep sleep wasted ;/
Dear Sara, currently I am setting up an online course for the children of our DoderDojo club of LeusdenZeT in the Netherlands. I am referring to the pin layout of the MCU 8266, see: https://www.appligate.nl/RASPIKIDS/stable/chapter8/#Stap-4-Stuur-de-programma's-naar-de-ESP8266. Would you be willing to give me permission to use the pin layout?
Hi.
Yes, you can use it as long as you reference our work.
Thank you.
Regards,
Sara
Thank you!
my problem is that I’m using 8 channel relay so i don’t which other three GPIOS to add so that it can control the remaining three relay apart from GPIOS (5 4 14 13 and 12
You can use a port expander or simply a 8 bit shift register.
Hello to you RNT,
Every time I search for info on ESP I always find the best answers on your site. Very good work.
I was hoping to use GPIO 14,12 and 13 as outputs but the test I have done on the 3 units I have tells me that they go High On Boot. Actually, same as GPIO16.
I wonder why I get different results as what you are showing in the text above.
Hi.
What are your results?
Regards.
Sara
Hello Sara,
I see GPIO 12,13,14 high on boot
This is my code:
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <Firebase_ESP_Client.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
// Provide the token generation process info.
#include “addons/TokenHelper.h”
// Provide the RTDB payload printing info and other helper functions.
#include “addons/RTDBHelper.h”
int input1;
// Insert your network credentials
#define WIFI_SSID “OPPOA53”
#define WIFI_PASSWORD “12345678”
// Insert Firebase project API Key
#define API_KEY “AIzaSyD3MrS7YiEXffnsQqOKa2qh2E4epmmTc30”
// Insert Authorized Email and Corresponding Password
#define USER_EMAIL “[email protected]”
#define USER_PASSWORD “123456789”
// Insert RTDB URLefine the RTDB URL
#define DATABASE_URL “https://qtmt-c9731-default-rtdb.firebaseio.com/”
// Define Firebase objects
FirebaseData fbdo;
FirebaseAuth auth;
FirebaseConfig config;
// Variable to save USER UID
String uid;
// Database main path (to be updated in setup with the user UID)
String databasePath;
// Database child nodes
String ppmPath = “/ppm”;
String timePath = “/timestamp”;
// Parent Node (to be updated in every loop)
String parentPath;
FirebaseJson json;
// Define NTP Client to get time
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, “pool.ntp.org”);
// Variable to save current epoch time
int timestamp;
// BME280 sensor
float ppm;
// Timer variables (send new readings every three minutes)
unsigned long sendDataPrevMillis = 0;
unsigned long timerDelay = 180000;
// Initialize WiFi
void initWiFi() {
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print(“Connecting to WiFi ..”);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(‘.’);
delay(1000);
}
Serial.println(WiFi.localIP());
Serial.println();
}
// Function that gets current epoch time
unsigned long getTime() {
timeClient.update();
unsigned long now = timeClient.getEpochTime();
return now;
}
void setup(){
Serial.begin(115200);
// Initialize BME280 sensor
initWiFi();
timeClient.begin();
// Assign the api key (required)
config.api_key = API_KEY;
// Assign the user sign in credentials
auth.user.email = USER_EMAIL;
auth.user.password = USER_PASSWORD;
// Assign the RTDB URL (required)
config.database_url = DATABASE_URL;
Firebase.reconnectWiFi(true);
fbdo.setResponseSize(4096);
// Assign the callback function for the long running token generation task */
config.token_status_callback = tokenStatusCallback; //see addons/TokenHelper.h
// Assign the maximum retry of token generation
config.max_token_generation_retry = 5;
// Initialize the library with the Firebase authen and config
Firebase.begin(&config, &auth);
// Getting the user UID might take a few seconds
Serial.println(“Getting User UID”);
while ((auth.token.uid) == “”) {
Serial.print(‘.’);
delay(1000);
}
// Print user UID
uid = auth.token.uid.c_str();
Serial.print(“User UID: “);
Serial.println(uid);
// Update database path
databasePath = “/UsersData/” + uid + “/readings”;
}
void loop(){
input1 = analogRead(A0);
Serial.println(input1);
// Send new readings to database
if (Firebase.ready() && (millis() – sendDataPrevMillis > timerDelay || sendDataPrevMillis == 0)){
sendDataPrevMillis = millis();
//Get current timestamp
timestamp = getTime();
Serial.print ("time: ");
Serial.println (timestamp);
parentPath= databasePath + "/" + String(timestamp);
json.set(ppmPath.c_str(), String(input1));
json.set(timePath, String(timestamp));
Serial.printf("Set json... %s\n", Firebase.RTDB.setJSON(&fbdo, parentPath.c_str(), &json) ? "ok" : fbdo.errorReason().c_str());
}
}
It only send data of MQ135 for 1 time to realtime database. Can you help me with this. Thank you so much.
Sorry if already been asked.
Do you have a similar guide for the ESP32
Hi.
Yes. You can check it out here: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/
Regards,
Sara
Parabéns, Sara e Rui.
Tudo feito com profissionalismo.
Obrigado.
Júlio Silva
Obrigada.
Cumprimentos,
Sara
what is the intended pin of esp8266 for sim800l evb gsm?GRPS? thanks a lot
Best esp8266 pinout description on the net!
I lost link to this page and spent 20 minutes today searching for it again 🙂
Thank you Sara!
Thanks.
I’m glad you find it useful.
Regards,
Sara